/*
 * Copyright 2013-2015 the original author or authors.
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package com.xdtech.hotel.monitor;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;

import org.apache.commons.lang.StringUtils;

/**
 * 房间监控数据模型
 * @author max.zheng
 * @create 2015-5-1下午4:45:48
 * @since 1.0
 * @see
 */
public class RoomMonitorInfo implements Comparable{
	
	public RoomMonitorInfo() {
		super();
	}
	
	public RoomMonitorInfo(Long id, String roomNo, String status, String sn,String serviceArea,String type) {
		super();
		this.id = id;
		this.roomNo = roomNo;
		this.status = status;
		this.sn = sn;
		this.serviceArea = serviceArea;
		this.type = type;
	}

	private Long id;
	private String roomNo;
	private String status;
	private String sn;
	private String serviceArea;
	private String type;
	private String customer;
	private String roomFloor;
	private Map<String, String> operationStatus = new ConcurrentHashMap<String, String>();
//	private List<ComponentInfo> componentInfos = new ArrayList<ComponentInfo>();
	private Map<String, ComponentInfo> compomentInfosMap = new HashMap<String, ComponentInfo>();
	
	private String faultInfo;
	
	//占用
	private String occupy;
	//门状态
	private String doorStatus;
	
	//空调开关
	private String acPower;
	//温度
	private String acTemp;
	//模式
	private String acMode;
	
	/**场景*/
	private String scene;
	/**时间*/
	private String time;
	public Long getId() {
		return id;
	}
	public void setId(Long id) {
		this.id = id;
	}
	public String getRoomNo() {
		return roomNo;
	}
	public void setRoomNo(String roomNo) {
		this.roomNo = roomNo;
	}
	public String getStatus() {
		return status;
	}
	public void setStatus(String status) {
		this.status = status;
	}
	public String getSn() {
		return sn;
	}
	public void setSn(String sn) {
		this.sn = sn;
	}

	public String getServiceArea() {
		return serviceArea;
	}

	public void setServiceArea(String serviceArea) {
		this.serviceArea = serviceArea;
	}

	public String getType() {
		return type;
	}

	public void setType(String type) {
		this.type = type;
	}

	public String getCustomer() {
		return customer;
	}

	public void setCustomer(String customer) {
		this.customer = customer;
	}

	
	public Map<String, String> getOperationStatus() {
		return operationStatus;
	}

	public void setOperationStatus(Map<String, String> operationStatus) {
		this.operationStatus = operationStatus;
	}

	public Map<String, ComponentInfo> getCompomentInfosMap() {
		return compomentInfosMap;
	}

	public void updateCompomentInfos(ComponentInfo compomentInfos) {
		compomentInfosMap.put(compomentInfos.getAddr(), compomentInfos);
	}

	public String getScene() {
		return scene;
	}

	public void setScene(String scene) {
		this.scene = scene;
	}

	public String getTime() {
		return time;
	}

	public void setTime(String time) {
		this.time = time;
	}

	public String getRoomFloor() {
		return roomFloor;
	}

	public void setRoomFloor(String roomFloor) {
		this.roomFloor = roomFloor;
	}

	/* (非 Javadoc)
	 * compareTo
	 * <p>对override方法的补充说明，若不需要则删除此行</p>
	 * 
	 * @param o
	 * @return
	 * @see java.lang.Comparable#compareTo(java.lang.Object)
	 */
	@Override
	public int compareTo(Object o)
	{
		
		RoomMonitorInfo rmi = (RoomMonitorInfo)o;
		String otherRoomNo = rmi.getRoomNo();
		return this.roomNo.compareTo(otherRoomNo);
	}
	
	public String getFaultInfo() {
		return faultInfo;
	}

	public void setFaultInfo(String faultInfo) {
		this.faultInfo = faultInfo;
	}

	public String getOccupy() {
		return occupy;
	}

	public void setOccupy(String occupy) {
		this.occupy = StringUtils.isBlank(occupy)?"无人":occupy;
	}

	public String getDoorStatus() {
		return doorStatus;
	}

	public void setDoorStatus(String doorStatus) {
		this.doorStatus = StringUtils.isBlank(doorStatus)?"off":doorStatus;
	}

	public String getAcTemp() {
		return acTemp;
	}

	public void setAcTemp(String acTemp) {
		this.acTemp = StringUtils.isBlank(acTemp)?"未知":acTemp;
	}

	public String getAcMode() {
		return acMode;
	}

	public void setAcMode(String acMode) {
		this.acMode = acMode;
	}

	
	public String getAcPower() {
		return acPower;
	}

	public void setAcPower(String acPower) {
		this.acPower = acPower;
	}

	public static void main(String[] args)
	{
		System.out.println("105".compareTo("104"));
	}
}
